{
 "cells": [
  {
   "metadata": {},
   "cell_type": "markdown",
   "source": [
    "# Shake Button\n",
    "\n",
    "This notebook renders a button using the [Kotlin UI DSL](https://plugins.jetbrains.com/docs/intellij/kotlin-ui-dsl-version-2.html) with an action assigned to shake your IDE."
   ]
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": "%use intellij-platform",
   "outputs": [],
   "execution_count": null
  },
  {
   "metadata": {},
   "cell_type": "code",
   "source": [
    "import com.intellij.openapi.ui.DialogEarthquakeShaker\n",
    "import com.intellij.openapi.wm.WindowManager\n",
    "import com.intellij.ui.dsl.builder.panel\n",
    "import com.intellij.util.ui.JBUI\n",
    "\n",
    "panel {\n",
    "    row {\n",
    "        button(\"Shake it!\") {\n",
    "            val project = currentProject()\n",
    "            val window = WindowManager.getInstance().getFrame(project)\n",
    "\n",
    "            DialogEarthquakeShaker.shake(window)\n",
    "        }\n",
    "    }\n",
    "}.apply {\n",
    "    size = JBUI.size(500, 200)\n",
    "    border = JBUI.Borders.empty(10, 20)\n",
    "}"
   ],
   "outputs": [],
   "execution_count": null
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Kotlin",
   "language": "kotlin",
   "name": "kotlin"
  },
  "language_info": {
   "name": "kotlin",
   "version": "2.2.20-dev-4982",
   "mimetype": "text/x-kotlin",
   "file_extension": ".kt",
   "pygments_lexer": "kotlin",
   "codemirror_mode": "text/x-kotlin",
   "nbconvert_exporter": ""
  },
  "ktnbPluginMetadata": {
   "sessionRunMode": "IDE_PROCESS"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
